package cn.gson.boot.model.pojos;

import javax.persistence.*;
import java.math.BigDecimal;

/*订单详情*/
@Entity
@Table(name = "dingdanxiangqing")
public class CFGMDingdanxiangqing {
    private int ddxqId;//订单详情id
    private Productt productt;//产品id
    /*private Integer ddId;*/
    private Integer ddcpNum;//订单详情产品数量
    private BigDecimal ddcpPrice;//订单详情产品价格
    private CFGMDingdan dingdanByDdId;//订单对象（订单）

    private BigDecimal ddxqXiaoji;//小计

    @Basic
    @Column(name = "ddxq_xiaoji")
    public BigDecimal getDdxqXiaoji() {
        return ddxqXiaoji;
    }

    public void setDdxqXiaoji(BigDecimal ddxqXiaoji) {
        this.ddxqXiaoji = ddxqXiaoji;
    }

    @Id
    @Column(name = "ddxq_id", nullable = false)
    @GeneratedValue(strategy = GenerationType.IDENTITY,generator = "seq")
    public int getDdxqId() {
        return ddxqId;
    }

    public void setDdxqId(int ddxqId) {
        this.ddxqId = ddxqId;
    }

    @ManyToOne
    @JoinColumn(name = "productt_id", referencedColumnName = "productt_id")
    public Productt getProductt() {
        return productt;
    }

    public void setProductt(Productt productt) {
        this.productt = productt;
    }


    @Basic
    @Column(name = "ddcp_num", nullable = true, precision = 0)
    public Integer getDdcpNum() {
        return ddcpNum;
    }

    public void setDdcpNum(Integer ddcpNum) {
        this.ddcpNum = ddcpNum;
    }

    @Basic
    @Column(name = "ddcp_price", nullable = true, precision = 2)
    public BigDecimal getDdcpPrice() {
        return ddcpPrice;
    }

    public void setDdcpPrice(BigDecimal ddcpPrice) {
        this.ddcpPrice = ddcpPrice;
    }


    @ManyToOne
    @JoinColumn(name = "dd_id", referencedColumnName = "dd_id")
    public CFGMDingdan getDingdanByDdId() {
        return dingdanByDdId;
    }

    public void setDingdanByDdId(CFGMDingdan dingdanByDdId) {
        this.dingdanByDdId = dingdanByDdId;
    }
}
